package com.example.websocket.html;

import java.io.Serializable;
import java.util.List;

public class GoodsPO implements Serializable {

    private String code;

    private String abbrCode;

    private String name;

    private String ext;

    private String tax;

    private String isTax;

    private String basis;

    private String specialCode;

    private String keyword;

    private String statisticsCode;

    private String policy;

    private String policyType;

    private String useTax;

    private String isTree;

    private String hidden;

    private String manage;

    private String consume;

    private String consumeCode;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAbbrCode() {
        return abbrCode;
    }

    public void setAbbrCode(String abbrCode) {
        this.abbrCode = abbrCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getExt() {
        return ext;
    }

    public void setExt(String ext) {
        this.ext = ext;
    }

    public String getTax() {
        return tax;
    }

    public void setTax(String tax) {
        this.tax = tax;
    }

    public String getIsTax() {
        return isTax;
    }

    public void setIsTax(String isTax) {
        this.isTax = isTax;
    }

    public String getBasis() {
        return basis;
    }

    public void setBasis(String basis) {
        this.basis = basis;
    }

    public String getSpecialCode() {
        return specialCode;
    }

    public void setSpecialCode(String specialCode) {
        this.specialCode = specialCode;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getStatisticsCode() {
        return statisticsCode;
    }

    public void setStatisticsCode(String statisticsCode) {
        this.statisticsCode = statisticsCode;
    }

    public String getPolicy() {
        return policy;
    }

    public void setPolicy(String policy) {
        this.policy = policy;
    }

    public String getPolicyType() {
        return policyType;
    }

    public void setPolicyType(String policyType) {
        this.policyType = policyType;
    }

    public String getUseTax() {
        return useTax;
    }

    public void setUseTax(String useTax) {
        this.useTax = useTax;
    }

    public String getIsTree() {
        return isTree;
    }

    public void setIsTree(String isTree) {
        this.isTree = isTree;
    }

    public String getHidden() {
        return hidden;
    }

    public void setHidden(String hidden) {
        this.hidden = hidden;
    }

    public String getManage() {
        return manage;
    }

    public void setManage(String manage) {
        this.manage = manage;
    }

    public String getConsume() {
        return consume;
    }

    public void setConsume(String consume) {
        this.consume = consume;
    }

    public String getConsumeCode() {
        return consumeCode;
    }

    public void setConsumeCode(String consumeCode) {
        this.consumeCode = consumeCode;
    }

    public GoodsPO(List<String> text) {
        for (int i = 0; i < text.size(); i++){
            switch (i){
                case 0:
                    this.code = text.get(i);
                    if (text.get(i).length() < 19){
                        for (int j = 1; j <= 19 - text.get(i).length(); j++){
                            this.code += "0";
                        }
                    }
                    break;
                case 1:
                    this.abbrCode = text.get(i);
                    break;
                case 2:
                    this.name = text.get(i);
                    break;
                case 3:
                    this.ext = text.get(i);
                    break;
                case 4:
                    this.tax = text.get(i);
                    break;
                case 5:
                    this.isTax = text.get(i);
                    break;
                case 6:
                    this.basis = text.get(i);
                    break;
                case 7:
                    this.specialCode = text.get(i);
                    break;
                case 8:
                    this.keyword = text.get(i);
                    break;
                case 9:
                    this.statisticsCode = text.get(i);
                    break;
                case 10:
                    this.policy = text.get(i);
                    break;
                case 11:
                    this.policyType = text.get(i);
                    break;
                case 12:
                    this.useTax = text.get(i);
                    break;
                case 13:
                    this.isTree = text.get(i);
                    break;
                case 14:
                    this.hidden = text.get(i);
                    break;
                case 15:
                    this.manage = text.get(i);
                    break;
                case 16:
                    this.consume = text.get(i);
                    break;
                case 17:
                    this.consumeCode = text.get(i);
                    break;
            }
        }
    }

    public GoodsPO() {
    }

    @Override
    public String toString() {
        return "GoodsPO{" +
                "code='" + code + '\'' +
                ", abbrCode='" + abbrCode + '\'' +
                ", name='" + name + '\'' +
                ", ext='" + ext + '\'' +
                ", tax='" + tax + '\'' +
                ", isTax='" + isTax + '\'' +
                ", basis='" + basis + '\'' +
                ", specialCode='" + specialCode + '\'' +
                ", keyword='" + keyword + '\'' +
                ", statisticsCode='" + statisticsCode + '\'' +
                ", policy='" + policy + '\'' +
                ", policyType='" + policyType + '\'' +
                ", useTax='" + useTax + '\'' +
                ", isTree='" + isTree + '\'' +
                ", hidden='" + hidden + '\'' +
                ", manage='" + manage + '\'' +
                ", consume='" + consume + '\'' +
                ", consumeCode='" + consumeCode + '\'' +
                '}';
    }

    public GoodsPO(GoodsPO po) {
        this.code = po.getCode();
    }
}
